[#ftl]
[@define "agile.form.TimeTextBox" "agile.form.DateTimeTextBoxMixin"]
category:"TimeTextBox Component"
,widgetName:"TimeTextBox"
,attributes:agile.delegate(agile.form.DateTimeTextBoxMixin.prototype.attributes,{			
	value: lang.mixin({},agile.TimeMetadata,{})					
	,"constraints.min":lang.mixin({},agile.TimeMetadata,{
			label:"i18n_min_value"
			,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){
				if(!value){
					value = agile.TimeMetadata.MINIMUM;
//					widget.metadata(name,null);
					widget.metadata(this.metadataCategory+"."+name,null);
				}else{
//					widget.metadata(name,value);
					widget.metadata(this.metadataCategory+"."+name,value);
				}
				widget.delegate.constraints.min = value;	
			}
	})
	,"constraints.max":lang.mixin({},agile.TimeMetadata,{
			label:"i18n_max_value"
			,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){						
				if(!value){
					value = agile.TimeMetadata.MAXIMUM;
//					widget.metadata(name,null);
					widget.metadata(this.metadataCategory+"."+name,null);
				}
				else{
//					widget.metadata(name,value);
					widget.metadata(this.metadataCategory+"."+name,value);
				}
				widget.delegate.constraints.max = value;		
			}		
	})
	,"constraints.selector":{
		options:agile.i18nMap(["time","datetime"],null,true)
	}			
	,"constraints.formatLength":lang.mixin({},agile.ComboMetadata, {
			label:"i18n_format_length"
			,options:agile.i18nMap(["short","long"],null,true)
			,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){					
				if(value == "default"){
					value = null;
				}
				var dateValue = widget.delegate.get("value");										
				widget.delegate.constraints.formatLength = value;
//				widget.metadata(name,value);								
				widget.metadata(this.metadataCategory+"."+name,value);
				widget.delegate.reset1("value",dateValue);					
			}
	})
	,"constraints.timePattern":lang.mixin({},agile.ComboMetadata,{
		label:"i18n_time_pattern"
		,options:agile.i18nMap(["hh:mm a","HH:mm","hh:mm:ss a","HH:mm:ss","hh:mm:ss.SSS a","HH:mm:ss.SSS"],null,true)			
		,onValueChange:function(/*widget*/widget,/*String*/name,/*Object*/value){
			if(value == "default"){
				value = null;
			}
			var timeValue = widget.delegate.get("value");
			widget.delegate.constraints.timePattern=value;
			widget.metadata(this.metadataCategory+"."+name,value);
			widget.delegate.reset1("value",timeValue);
		}
	})
	,"constraints.clickableIncrement":lang.mixin({},agile.TimeNumberMetadata,{
		label:"i18n_clickable_increment",unit:"min",placeHolder:"15min"
		,onValueChange:function(widget,name,value){
			if(!value){
				value = "T00:15:00";
			}
			widget.delegate.constraints.clickableIncrement=value;
			widget.metadata(this.metadataCategory+"."+name,value);
		}
	})
	,"constraints.visibleIncrement":lang.mixin({},agile.TimeNumberMetadata,{
		label:"i18n_visible_increment",unit:"min",placeHolder:"60min"
		,onValueChange:function(widget,name,value){
			if(!value){
				value = "T01:00:00";
			}
			widget.delegate.constraints.visibleIncrement=value;
			widget.metadata(this.metadataCategory+"."+name,value);
		}
	})
	,"constraints.visibleRange":lang.mixin({},agile.TimeNumberMetadata,{
		label:"i18n_visible_range",unit:"min",placeHolder:"120min"
		,onValueChange:function(widget,name,value){
			if(!value){
				value = "T05:00:00";
			}
			widget.delegate.constraints.visibleRange=value;
			widget.metadata(this.metadataCategory+"."+name,value);
		}
	})
})	
,_getDelegatePrototype:function(){
	agile.requireX("dijit/form/TimeTextBox");
//	this.metadata("dojoDeclaredClass","dijit/form/TimeTextBox");
	return dijit.form.TimeTextBox.prototype;
}
//,constructor: function(){	
//	//this.metadata("parameters.constraints.clickableIncrement","T00:15:00");
//	agile.requireX("dijit/form/TimeTextBox");
//}
//,init:function(){
//	
//}
[/@]
